// 单例模式
// console.log('singlation')

interface ISingle {
  instance: any;
  getInstance: () => any;
}

interface IInstance {
  tag: number
}

class Singlation implements ISingle {
  instance: null | IInstance
  getInstance() {
    if (!this.instance) {
      this.initInstance();
    }
    return this.instance;
  }
  initInstance() {
    this.instance = {
      tag: new Date().getTime()
    }
  }
}

export default Singlation